package com.zzxx.mapper;

import com.zzxx.entity.UserContent;
import com.zzxx.entity.UserContentExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface UserContentMapper {
    @SelectProvider(type=UserContentSqlProvider.class, method="countByExample")
    long countByExample(UserContentExample example);

    @DeleteProvider(type=UserContentSqlProvider.class, method="deleteByExample")
    int deleteByExample(UserContentExample example);

    @Delete({
        "delete from usercontent",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    @Insert({
        "insert into usercontent (id, contentId, ",
        "userId)",
        "values (#{id,jdbcType=VARCHAR}, #{contentid,jdbcType=VARCHAR}, ",
        "#{userid,jdbcType=VARCHAR})"
    })
    int insert(UserContent row);

    @InsertProvider(type=UserContentSqlProvider.class, method="insertSelective")
    int insertSelective(UserContent row);

    @SelectProvider(type=UserContentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="contentId", property="contentid", jdbcType=JdbcType.VARCHAR),
        @Result(column="userId", property="userid", jdbcType=JdbcType.VARCHAR)
    })
    List<UserContent> selectByExample(UserContentExample example);

    @Select({
        "select",
        "id, contentId, userId",
        "from usercontent",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="contentId", property="contentid", jdbcType=JdbcType.VARCHAR),
        @Result(column="userId", property="userid", jdbcType=JdbcType.VARCHAR)
    })
    UserContent selectByPrimaryKey(String id);

    @UpdateProvider(type=UserContentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") UserContent row, @Param("example") UserContentExample example);

    @UpdateProvider(type=UserContentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") UserContent row, @Param("example") UserContentExample example);

    @UpdateProvider(type=UserContentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(UserContent row);

    @Update({
        "update usercontent",
        "set contentId = #{contentid,jdbcType=VARCHAR},",
          "userId = #{userid,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(UserContent row);
}